import request from '@/utils/request';

// 查询移库单列表
export function listMovementOrder(query: Record<string, any>) {
  return request({
    url: '/wms/movementOrder/list',
    method: 'get',
    params: query
  })
}

// 查询移库单详细
export function getMovementOrder(orderId: string | number) {
  return request({
    url: '/wms/movementOrder/' + orderId,
    method: 'get'
  })
}

// 新增移库单
export function addMovementOrder(data: Record<string, any>) {
  return request({
    url: '/wms/movementOrder',
    method: 'post',
    data: data
  })
}

// 修改移库单
export function updateMovementOrder(data: Record<string, any>) {
  return request({
    url: '/wms/movementOrder',
    method: 'put',
    data: data
  })
}

// 删除移库单
export function delMovementOrder(orderId: string | number | string[]) {
  const ids = Array.isArray(orderId) ? orderId.join(',') : orderId;
  return request({
    url: '/wms/movementOrder/' + ids,
    method: 'delete'
  })
}

// 导出移库单
export function exportMovementOrder(query: Record<string, any>) {
  return request({
    url: '/wms/movementOrder/export',
    method: 'post',
    data: query
  })
}

// 移库单审核
export function auditMovementOrder(orderId: string | number, status: number) {
  return request({
    url: '/wms/movementOrder/audit',
    method: 'put',
    data: { orderId, status }
  })
}

// 移库单移库
export function movementMovementOrder(orderId: string | number) {
  return request({
    url: '/wms/movementOrder/movement/' + orderId,
    method: 'put'
  })
}




